package com.jyxd.web.data.patient;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 患者中间表
 */
@Entity
@Table(name = "p_patient_middle")
@Data
@TableName(value ="p_patient_middle" )
@ApiModel(value="患者中间表", description="")
public class PatientMiddle extends Model implements Serializable {

    /**
     * 序列
     */
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @Id
    @Column(name = "id", length = 32, nullable = false)
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid.hex")
    private String id;

    @ApiModelProperty("患者id")
    @Column(name = "patient_id")
    private String patientId;

    @ApiModelProperty("患者病历号id")
    @Column(name = "visit_code")
    private String visitCode;

    /**
     * 转入科室编码
     */
    @ApiModelProperty(value = "转入科室编码")
    @Column(name = "in_department_code")
    private String inDepartmentCode;

    /**
     * 当前科室编码
     */
    @ApiModelProperty(value = "当前科室编码")
    @Column(name = "department_code")
    private String departmentCode;

    /**
     * 转出科室编码
     */
    @ApiModelProperty(value = "转出科室编码")
    @Column(name = "to_department_code")
    private String toDepartmentCode;

    /**
     * 当前病区编码
     */
    @ApiModelProperty(value = "当前病区编码")
    @Column(name = "ward_code")
    private String wardCode;


    /**
     * 转出病区编码
     */
    @ApiModelProperty(value = "转出病区编码")
    @Column(name = "to_ward_code")
    private String toWardCode;


    @ApiModelProperty("创建时间")
    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;


    /**
     * 重症转入或转出
     */
    @ApiModelProperty(value = "重症转入或转出")
    @Column(name = "status")
    private String status;


    /**
     * 床号
     */
    @Column(name = "bed_code")
    private String bedCode;
}
